﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Npgsql;

namespace SmartRS.com.vn.smartrs
{
    class InitDB
    {
        private static NpgsqlConnection connection;

        public InitDB()
        {
            createConnection();
        }


        public static NpgsqlConnection createConnection()
        {
            //open conneted to DB
            if (connection == null)
            {
                connection = new NpgsqlConnection("Server=127.0.0.1;Port=5432;Database=SmartRS;User Id=postgres;Password=postgres;");
                connection.Open();

            }

            return connection;
        }
    }
}
